home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
319_01
/
cpp.doc
< prev
next >
Wrap
Text File
|
1990-06-16
|
3KB
|
119 lines
CPP Version 5.3: August 4, 1989.
INTRODUCTION
This file briefly describes CPP, a Preprocessor Program for the C language.
For an introduction to C and the C preprocessor, see K&R, i.e., the book,
The C Programming Language, second edition, by Kernighan and Ritchie, published
by Prentice Hall.
As far as is known, CPP meets all specifications in the Draft C
Standard of January, 1988. Please report all bugs to:
Edward K. Ream
1617 Monroe Street
Madison, WI 53711
(608) 257-0802.
OVERVIEW
CPP copies an input file to an output file, doing the following as it does so:
o It includes files into the output file. Included files may include other
include files to any depth.
o It expands macros. Macros may have arguments and may call other macros.
The details of macro processing are EXTREMELY complicated. See the Draft C
Standard of January, 1988 for full details.
o It conditionally includes lines from the input files. These directives may
be nested to any depth.
o It eliminates all comments by default, though comments may be included in
the output file if desired.
PREPROCESSOR DIRECTIVES
CPP supports the following preprocessing directives. See K&R or the Draft C
standard for a description of what these directives do.
#define identifier replacement_text
#define identifier(argument_list) replacement_text
#elif
#else
#endif
#error
#if constant_expression
#ifdef identifier
#ifndef identifier
#include "filename"
#include <filename>
#include tokens
#line line_number [optional_file_name]
#pragma
#undef identifier
USAGE
Invoke CPP as follows:
CPP input_file output_file [optional_arguments]
The following arguments are optional:
-c
Include comments and extra white space in the output file. By default,
comments and extra white space are excluded from the output file.
-d identifier
-d identifier=definition
Define an identifier on the command line, just as if
#define identifier definition
appeared at the start of the input file. The equal sign is not part of the
definition of the identifier. If the equal sign and definition are omitted, an
empty definition is created.
Whitespace is required between the -d and the identifier.
-n
Allow nested comments. By default, CPP follows the C standard and disallows
constructions such as
/* comment out -----
a = 5;
/* This is a nested comment. */
----- end comment out */
-s path
Specify one or more "standard places" to search when looking for included
files. For example:
CPP in out -s \src -s d:\src\headers
If no -s option is specifed, CPP uses \usr\include.
Whitespace is required between the -s and the path.
-u identifier
Cancel the first definition of identifier, as if #undef identifier were
inserted immediately following the that definition.